package com.example.demo.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import com.example.demo.pojo.Like;
@Repository
@Transactional
public interface LikeDao extends JpaRepository<Like, Long> {
	public List<Like> findByUserId(String id);
	
	@Query(value = "delete from user_like where user_id= ?1 and good_id= ?2", nativeQuery = true)
	@Modifying
	void deleteByUserIdAndGoodId(String uid, String gid);
}
